#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#define DATABASE_FILE_PATH ("../HospitalManagement.db")
#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include<QLabel>
#include <QSqlDatabase>
#include <QSqlQuery>
#include<QSqlError>
#include<QDateTime>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class communication_doctor : public QMainWindow
{
    Q_OBJECT

public:
    communication_doctor(int currentID, QString &role, QWidget *parent = nullptr);
    ~communication_doctor();

void storeDataInDatabase(const QByteArray &data);

void displayDatabaseContents();

private slots:
//    void on_setlisten_clicked();

    void on_sendMsg_clicked();

//    void on_pushButton_clicked();
////新增通信曹函数
//    void on_connect_clicked();
//    void on_disconnect_clicked();
private:
    Ui::MainWindow *ui;
    QTcpServer *m_s;
    QTcpSocket *m_tcp;
    QLabel *m_status;
    QSqlDatabase db;
    int currentID;
    QString role;
};

#endif // MAINWINDOW_H
